package edu.cmu.ece.ds.droidchat.message;

import java.io.Serializable;

/**
 * An object that represent the response to a login request from the 
 *  DroidChat server back to the DroidChat user
 *  
 *  a subclass of "DroidChatMessage"
 */
public class ClientLoginResponseMessage extends DroidChatMessage implements Serializable{
	
	// possible response codes
	public static final int NO_USER = 1;
	public static final int WRONG_PASSWORD = 2;
	public static final int LOGIN_SUCCESSFUL = 3;
	
	private String username;
	private int response = 0; // the response code
	
	private int login_session_id = 0; // the login session id, valid only if login
	                                  //  was successful
	
	public ClientLoginResponseMessage(String username, int reponse) {
		super(DroidChatMessage.CLIENT_LOGIN_RESPONSE);
		this.username = username;
		this.response = reponse;
	}

	// return the response code of this ClientLoginResponseMessage
	public int getResponse()      {	  return response;			}
	public String getUsername()   {   return username;    		}
	public int getLoginSessionID(){   return login_session_id;	}
	
	public void setLoginSessionID(int s) { this.login_session_id = s; }
}
